
    using SmartSoft.DAL;
    using System.Web.Services;
    using System;
    using System.Data;
    using System.Data.SqlClient;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.None)]
public class WSDmTsDataAccess : System.Web.Services.WebService
{
    private DmTsDataAccess objDataAccess = new DmTsDataAccess();
    public WSDmTsDataAccess()
    {
    }


    [WebMethod]
    public bool DeleteDetailRow0(object po_MasterKey, object po_KeyCode)
    {
        object[] arr = Validator.Validate(po_MasterKey, po_KeyCode);
        return objDataAccess.DeleteDetailRow0(arr[0], arr[1]);
    }

    [WebMethod]
    public bool DeleteDetailRow2(object po_MasterKey, object po_KeyCode)
    {
        object[] arr = Validator.Validate(po_MasterKey, po_KeyCode);
        return objDataAccess.DeleteDetailRow2(arr[0], arr[1]);
    }


    [WebMethod]
    public DataTable Depreciation(string ps_Subsidiary, object pd_Ngay_Ct1, object pd_Ngay_Ct2)
    {
        object[] arr = Validator.Validate(pd_Ngay_Ct1, pd_Ngay_Ct2);
        return objDataAccess.Depreciation(ps_Subsidiary, arr[0], arr[1]);
    }

    [WebMethod]
    public DataSet GetDataSet(string ps_Subsidiary)
    {

        return objDataAccess.GetDataSet(ps_Subsidiary);
    }

    [WebMethod(MessageName = "2Params", Description = "", EnableSession = true)]
    public DataSet GetDataSet(string ps_Subsidiary, string ps_Loai_Ts)
    {
        return objDataAccess.GetDataSet(ps_Subsidiary, ps_Loai_Ts);
    }

    [WebMethod]
    public DataSet GetDataSetByParent(string ps_Subsidiary, string ps_Loai_Ts, string ps_ParentCode)
    {

        return objDataAccess.GetDataSetByParent(ps_Subsidiary, ps_Loai_Ts, ps_ParentCode);
    }

    [WebMethod]
    public DataTable GetDepreciation(string ps_Subsidiary, object pd_Ngay_Ct1, object pd_Ngay_Ct2)
    {
        object[] arr = Validator.Validate(pd_Ngay_Ct1, pd_Ngay_Ct2);
        return objDataAccess.GetDepreciation(ps_Subsidiary, arr[0], arr[1]);
    }

    [WebMethod]
    public DataTable GetDetailTable(object ps_KeyCode)
    {
        object[] arr = Validator.Validate(ps_KeyCode);
        return objDataAccess.GetDetailTable(arr[0]);
    }

    [WebMethod]
    public DataTable GetDetailTable0(object ps_KeyCode)
    {
        object[] arr = Validator.Validate(ps_KeyCode);
        return objDataAccess.GetDetailTable0(arr[0]);
    }

    [WebMethod]
    public DataTable GetDetailTable2(object ps_KeyCode)
    {
        object[] arr = Validator.Validate(ps_KeyCode);
        return objDataAccess.GetDetailTable2(arr[0]);
    }

    [WebMethod]
    public DataTable GetDetailTable3(object ps_KeyCode)
    {
        object[] arr = Validator.Validate(ps_KeyCode);
        return objDataAccess.GetDetailTable3(arr[0]);
    }

    [WebMethod]
    public DataTable GetMasterDataRow(object ps_KeyCode)
    {
        object[] arr = Validator.Validate(ps_KeyCode);
        return SSDataAccess.ConvertRowToTable(objDataAccess.GetMasterDataRow(arr[0]));
    }

    [WebMethod]
    public bool Save(bool pb_NewChecked, DataTable po_MasterDataRow, DataTable po_DetailDataTable)
    {

        return objDataAccess.Save(pb_NewChecked, po_MasterDataRow.Rows[0], po_DetailDataTable);
    }

    [WebMethod]
    public bool Save3(object ps_KeyCode, DataTable po_DetailDataTable)
    {
        object[] arr = Validator.Validate(ps_KeyCode);
        return objDataAccess.Save3(arr[0], po_DetailDataTable);
    }

    [WebMethod]
    public bool Save4(string ps_Subsidiary, object pd_Ngay_Ct1, object pd_Ngay_Ct2, DataTable po_DetailDataTable)
    {
        object[] arr = Validator.Validate(pd_Ngay_Ct1, pd_Ngay_Ct2);
        return objDataAccess.Save4(ps_Subsidiary, arr[0], arr[1], po_DetailDataTable);
    }


    [WebMethod]
    public int SaveDetailRow0(object po_MasterKey, DataTable tableRow)
    {
        object[] arr = Validator.Validate(po_MasterKey);
        return objDataAccess.SaveDetailRow0(arr[0], tableRow.Rows[0]);
    }

    [WebMethod]
    public int SaveDetailRow2(object po_MasterKey, DataTable tableRow)
    {
        object[] arr = Validator.Validate(po_MasterKey);
        return objDataAccess.SaveDetailRow2(arr[0], tableRow.Rows[0]);
    }

    [WebMethod]
    public int TaiSanG_Delete(object pi_MasterKey)
    {
        object[] arr = Validator.Validate(pi_MasterKey);
        return objDataAccess.TaiSanG_Delete(arr[0]);
    }

    [WebMethod]
    public void TaiSanG_Get(object pi_MasterKey, ref object pd_Ngay_Giam, ref object ps_So_Ct_G, ref object ps_Ma_Giam_Ts, ref object ps_Ten_Giam_Ts)
    {        
        objDataAccess.TaiSanG_Get(pi_MasterKey, ref  pd_Ngay_Giam, ref  ps_So_Ct_G, ref  ps_Ma_Giam_Ts, ref  ps_Ten_Giam_Ts);
    }

    [WebMethod]
    public int TaiSanG_Save(object pi_MasterKey, object pd_Ngay_Giam, object ps_So_Ct_G, object ps_Ma_Giam_Ts)
    {
        object[] arr = Validator.Validate(pi_MasterKey, pd_Ngay_Giam, ps_So_Ct_G, ps_Ma_Giam_Ts);
        return objDataAccess.TaiSanG_Save(arr[0], arr[1], arr[2], arr[3]);
    }
}